home *** CD-ROM | disk | FTP | other *** search
- //╔══════════════════════════════════════════════════════════════════════════╗
- //║ ║
- //║ This example show how to use Automatic Bank Switching with Vesa 1.0 ║
- //║ ║
- //║ ║
- //║ ║
- //╚══════════════════════════════════════════════════════════════════════════╝
-
- #include <process.h>
- #include "..\resource\eos.h"
-
- void copyvideo(long Selector_Vesa,char *Addr_File);
- #pragma aux copyvideo modify [eax edx esi edi] parm [eax] [esi] = \
- "push es"\
- "mov es,ax"\
- "xor edi,edi"\
- "add esi,10"\
- "mov edx,3c8h"\
- "xor al,al"\
- "out dx,al"\
- "inc dl"\
- "mov ecx,768"\
- "@@Ok1:"\
- "lodsb"\
- "out dx,al"\
- "loop @@Ok1"\
- "mov ecx,76800"\
- "rep movsd"\
- "pop es";
-
- void wait_();
- #pragma aux wait_ modify [eax]= \
- "xor ah,ah"\
- "int 16h";
-
- void test_vesa()
- {
- long Selector_Vesa;
- char *Addr_File;
- long Size_File,Handle_File;
- if (Init_Vesa(0x101)==Off)
- Exit_Error (" ■ Mode SVGA not supported or VESA not found ! \x0D\x0A" \
- " To install a vesa driver, refer to your video card documentation. \x0D\x0A\x24");
- Selector_Vesa=Init_Vesa_Bank();
- Addr_File=Load_External_File_Handle ("..\\DATA\\TEST640.DLZ",&Size_File,&Handle_File);
- copyvideo(Selector_Vesa,Addr_File);
- wait_();
- Restore_Video_Mode();
- }
-
- void main(int argn, char **argv)
- {
- Init_EOS();
- test_vesa();
- exit (0);
- }